const { ccclass, property } = cc._decorator;

@ccclass
export default class fail extends cc.Component {
    @property(cc.Label)
    nowScore: cc.Label = undefined
    @property(cc.Label)
    bestScore: cc.Label = undefined
    @property(cc.Node)
    backBtn: cc.Node = undefined
    @property(cc.Node)
    restartBtn: cc.Node = undefined
    @property(cc.Label)
    timeTxt: cc.Label = undefined

    init() {
        this.nowScore.string = this.timeTxt.string
        this.bestScore.string = cc.sys.localStorage.getItem('time')
        this.backBtn.on('touchstart', this.backEvent, this)
        this.restartBtn.on('touchstart', this.restartEvent, this)
    }

    private backEvent() {
        cc.director.loadScene('start')
    }
    private restartEvent() {
        cc.director.loadScene('game')

    }
    // update (dt) {}
}
